﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CommunityFieldOfActivitiesAdmin.ascx.cs"
    Inherits="Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenCommunity.CommunityFieldOfActivitiesAdmin" %>
<owc:OwGrid ID="CommunityFieldOfActivitiesGrid" runat="server" DataSourceID="OpenWebCommunityFieldOfActivitiesAdmin"
    SkinID="OwGridAdmin">
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="CommunityFieldOfActivityID"
        DataSourceID="OpenWebCommunityFieldOfActivitiesAdmin">
      <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="<%$OwR:AddNewRecordText %>"
            RefreshText="<%$ OwR:RefreshText %>"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <owct:GridBoundColumn DataField="CommunityFieldOfActivityID" DataType="System.Int64"
                FilterControlAltText="Filter CommunityFieldOfActivityID column" HeaderText="<%$OwR:Code %>"
                SortExpression="CommunityFieldOfActivityID" UniqueName="CommunityFieldOfActivityID">
            </owct:GridBoundColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn1 column" HeaderText="<%$ OwR:ThumbImage %>"
                UniqueName="TemplateColumn1">
                <ItemTemplate>
                    <div align="center">
                        <img src='<%# Eval("ThumbImage") %>' height="100" width="150" /></div>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:TitleLabel %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table>
                        
                        <tr>
                            <td>
                                <owc:OwR OwText="Language" runat="server" />
                            </td>
                            <td>
                                <%#Eval("LanguageCode") %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="Parent" runat="server" />
                            </td>
                            <td>
                          

                                    <%#OwCommunityFieldOfActivitiesBLL.OwGetEntity((long?)Eval("ParentID")).Name%>

                            </td>
                        </tr>  <tr>
                            <td>
                                <owc:OwR OwText="Name" runat="server" />
                            </td>
                            <td>
                          

                                    <%# Eval("Name")%>

                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="SortOrder" runat="server" />
                            </td>
                            <td>
                                <%#Eval("SortOrder")%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$OwR:InfoLabel %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <owc:OwR OwText="EnableBegin" runat="server" />
                            </td>
                            <td>
                                <%#Eval("EnableBegin")%>
                            </td>
                            <td>
                                <owc:OwR OwText="EnableEnd" runat="server" />
                            </td>
                            <td>
                                <%#Eval("EnableEnd")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="HomeDisplayBegin" runat="server" />
                            </td>
                            <td>
                                <%#Eval("HomeDisplayBegin")%>
                            </td>
                            <td>
                                <owc:OwR OwText="HomeDisplayEnd" runat="server" />
                            </td>
                            <td>
                                <%#Eval("HomeDisplayEnd")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="HotDisplayBegin" runat="server" />
                            </td>
                            <td>
                                <%#Eval("HotDisplayBegin")%>
                            </td>
                            <td>
                                <owc:OwR OwText="HotDisplayEnd" runat="server" />
                            </td>
                            <td>
                                <%#Eval("HotDisplayEnd")%>
                            </td>
                        </tr>
                    </table>
                         <table>
                        <tr>
                            <td>
                                <owc:OwR  OwText="CreatingUser" runat="server" />
                            </td>
                            <td>
                               
                                  <%#Eval("CreatingUser") != null ? (Membership.GetUser(Eval("CreatingUser")) != null ? Membership.GetUser(Eval("CreatingUser")).UserName : "n/a") : "" + " /"%>
                            </td>
                            <td>
                                <owc:OwR OwText="DateTimeCreated" runat="server" />
                            </td>
                            <td>
                                <%#Eval("DateTimeCreated")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR  OwText="EditingUser" runat="server" />
                            </td>
                            <td>
                       
                                  <%#Eval("EditingUser") != null ? (Membership.GetUser(Eval("EditingUser")) != null ? Membership.GetUser(Eval("EditingUser")).UserName : "n/a") : "" + " /"%>
                            </td>
                            <td>
                                <owc:OwR OwText="DateTimeEdited" runat="server" />
                            </td>
                            <td>
                                <%#Eval("DateTimeEdited")%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="DeletingUser" runat="server" />
                            </td>
                            <td>
                              
                                  <%#Eval("DeletingUser") != null ? (Membership.GetUser(Eval("DeletingUser")) != null ? Membership.GetUser(Eval("DeletingUser")).UserName : "n/a") : "" + " /"%>
                            </td>
                            <td>
                                <owc:OwR  OwText="DateTimeDeleted" runat="server" />
                            </td>
                            <td>
                                <%#Eval("DateTimeDeleted")%>
                            </td>
                        </tr>
                    </table>


                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="<%$ OwR:CommandLabel %>"
                UniqueName="TemplateColumn">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <owc:OwR OwText="IsHot" runat="server" />
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsHotCb" runat="server" Checked='<%#Eval("IsHot")%>' AutoPostBack="true" OnCheckedChanged="IsHot_CheckedChanged" 
                                    Text='<%#Eval("CommunityFieldOfActivityID")%>' CssClass="HiddenText" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="IsApproved" runat="server" />
                            </td>
                            <td>
                                <owc:OwCheckBox runat="server" Checked='<%#Eval("IsApproved")%>' AutoPostBack="true" ID="IsApprovedCb"
                                    Text='<%#Eval("CommunityFieldOfActivityID")%>' CssClass="HiddenText" OnCheckedChanged="IsApprovedCb_CheckedChanged"  />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR  OwText="IsHomeDisplay" runat="server" />
                            </td>
                            <td>
                                <owc:OwCheckBox runat="server" Checked='<%#Eval("IsHomeDisplay")%>' AutoPostBack="true" ID="IsHomeDisplayCb"
                                    Text='<%#Eval("CommunityFieldOfActivityID")%>' CssClass="HiddenText" OnCheckedChanged="IsHomeDisplayCb_CheckedChanged" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="IsDeleted" runat="server" />
                            </td>
                            <td>
                                <owc:OwCheckBox runat="server" Checked='<%#Eval("IsDeleted")%>' AutoPostBack="true" ID="IsDeletedCb"
                                    Text='<%#Eval("CommunityFieldOfActivityID")%>' CssClass="HiddenText" OnCheckedChanged="IsDeleted_CheckedChanged" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR OwText="IsEnabled" runat="server" />
                            </td>
                            <td>
                                <owc:OwCheckBox runat="server" Checked='<%#Eval("IsEnabled")%>' AutoPostBack="true" ID="IsEnabledCb"
                                    Text='<%#Eval("CommunityFieldOfActivityID")%>' CssClass="HiddenText" OnCheckedChanged="IsEnabledCb_CheckedChanged" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
             

            <owct:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn" HeaderText="<%$ OwR:Modify %>">
                <ItemTemplate>
                    <a href='/Admin/Views/Site/CommunityFieldOfActivitiesEdit.aspx?Id=<%#Eval("CommunityFieldOfActivityID")%>'>
                        <img src='/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/edit.gif' runat="server"
                            id="UpdateImage" /></a> 
                   
                </ItemTemplate>
            </owct:GridTemplateColumn>  <owct:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn" HeaderText="<%$ OwR:Delete %>">
                <ItemTemplate>
                    
                    <asp:ImageButton CausesValidation="true" OnClientClick='if(!confirm("Are you sure to  Delete?")) return false'
                        ID="EditDeleteButton1" CommandName="Delete" runat="server" SkinID="OwConfirmButton"
                        ImageUrl="/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/delete.gif" />
                </ItemTemplate>
            </owct:GridTemplateColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <%
           
                    Response.Redirect("CommunityFieldOfActivitiesEdit.aspx");
                %>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </HeaderContextMenu>
</owc:OwGrid>
<owc:OwObjectDataSource ID="OpenWebCommunityFieldOfActivitiesAdmin" runat="server"
    DataObjectTypeName="Micronet.OpenWeb.Entity.OwCommunityFieldOfActivitiesEntity"
    EnablePaging="true" SelectCountMethod="OwGetByDynamicCount" DeleteMethod="OwDelete"
    InsertMethod="OwInsert" OldValuesParameterFormatString="original_{0}" SelectMethod="OwGetByDynamic"
    TypeName="Micronet.OpenWeb.Com.BLL.OwCommunityFieldOfActivitiesBLL" UpdateMethod="OwUpdate">
    <SelectParameters>
        <asp:Parameter Name="parentID" Type="Int64" />
        <asp:Parameter Name="code" Type="String" />
        <asp:Parameter Name="isHomeDisplay" Type="Boolean" />
        <asp:Parameter Name="isHot" Type="Boolean" />
        <asp:Parameter Name="enableBegin" Type="DateTime" />
        <asp:Parameter Name="enableEnd" Type="DateTime" />
        <asp:Parameter Name="homeDisplayBegin" Type="DateTime" />
        <asp:Parameter Name="homeDisplayEnd" Type="DateTime" />
        <asp:Parameter Name="hotDisplayBegin" Type="DateTime" />
        <asp:Parameter Name="hotDisplayEnd" Type="DateTime" />
        <asp:Parameter Name="isApproved" Type="Boolean" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
        <asp:Parameter DbType="Guid" Name="creatingUser" />
        <asp:Parameter DbType="Guid" Name="editingUser" />
        <asp:Parameter DbType="Guid" Name="deletingUser" />
        <asp:Parameter Name="languageCode" Type="String" />
        <asp:Parameter Name="isEnabled" Type="Boolean" />
        <asp:Parameter Name="sortClause" Type="String" />
        <asp:Parameter Name="sortDirection" Type="String" />
        <asp:Parameter Name="startRowIndex" Type="Int32" />
        <asp:Parameter Name="maximumRows" Type="Int32" />
    </SelectParameters>
</owc:OwObjectDataSource>
